package com.junzhiit.nengji.cms.web.controller;

import java.util.Map;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bainaeco.framework.util.JsonUtil;

public class BaseController {

	public static final String RESULT_MESSAGE = "resultMsg";

	public static final String ERROR_MESSAGE = "errorMsg";

	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	@PostConstruct
	public void init() {
		logger.info("init");
	}

	@PreDestroy
	public void destroy() {
		logger.info("destroy");
	}
	
	protected Map<String, Object> ModelObject(Object object){
		return JsonUtil.toMap(object);
	}
}
